package com.baizhi.exceptionx;

/**
 * finally常见面试题
 * 请简述  final   finally   finalize 的区别
 */
public class ExceptionDemo06 {

    public static void main(String[] args) {
        System.out.println(test("0"));
        System.out.println(test(null));
        System.out.println(test(""));
    }

    public static int test(String str){
        try{
            return str.charAt(0) - '0';
        }catch (NullPointerException e){
            return 1;
        }catch (Exception e) {
            return 2;
        }finally{
            return 3;
        }
    }
}
